﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BuildingDrawer
{
    class E_Bar:E_Element
    {
        #region variable

        public int p1id;
        public int p2id;
        public E_Point p1;
        public E_Point p2;
        

        #endregion 

        #region function

        public E_Bar()
        {
            this.id = 0;
            p1 = new E_Point();
            p2 = new E_Point();
            p1id = 0;
            p2id = 0;
            type = 1;

        }
        public E_Bar(int id, int p1, int p2)
        {
            this.id = id;
            this.p1id = p1;
            this.p2id = p2;
            this.p1 = new E_Point();
            this.p2 = new E_Point();
            type = 1;
        }

        public E_Bar(int id, E_Point p1, E_Point p2)
        {
            this.id = id;
            this.p1 = p1;
            this.p2 = p2;
            this.p1id = p1.id;
            this.p2id = p2.id;
            type = 1;
        }

        public E_Bar(int id, float x1, float y1, float z1, float x2, float y2, float z2)
        {
            this.id = id;
            p1 = new E_Point(x1, y1, z1);
            p2 = new E_Point(x2, y2, z2);
            type = 1;
        }
        public E_Bar(int id, int id1, float x1, float y1, float z1, int id2, float x2, float y2, float z2)
        {
            this.id = id;
            p1 = new E_Point(id1, x1, y1, z1);
            p2 = new E_Point(id2, x2, y2, z2);
            type = 1;
        }

        public override Boolean isEqual(E_Element in_element)
        {
            E_Bar in_line = (E_Bar)in_element;
            if (in_line.id != id)
            {
                return false;
            }
            else
            {
                if ((in_line.p1id != p1id) || (in_line.p2id != p2id))
                {
                    return false;
                }
                return true;
            }
        }

        #endregion



    }
}
